package com.kotasoft.training.roogwteclipselink.client.managed.ui;

import com.google.gwt.requestfactory.ui.client.ProxyRenderer;

import com.kotasoft.training.roogwteclipselink.client.managed.request.DepartamentoProxy;
import java.util.Set;
import com.kotasoft.training.roogwteclipselink.client.managed.request.ProfesorProxy;
import com.kotasoft.training.roogwteclipselink.client.managed.ui.ProfesorSetEditor;

/**
 * Renders {@link DepartamentoProxy for display to the user. Requires the
 *  properties to have been fetched.
 */
public class DepartamentoProxyRenderer extends ProxyRenderer<DepartamentoProxy> {
  private static DepartamentoProxyRenderer INSTANCE;

  public static DepartamentoProxyRenderer instance() {
    if (INSTANCE == null) {
      INSTANCE = new DepartamentoProxyRenderer();
    }

    return INSTANCE;
  }

  protected DepartamentoProxyRenderer() {
    super(new String[] {"nombre"});
  }

  public String render(DepartamentoProxy object) {
    if (object == null) {
      return "";
    }
    return object.getNombre() + " (" + object.getId() + ")";
  }
}
